//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_IDEPARTITION_H__
#define __ELASTOS_IDEPARTITION_H__

#define DEVICENAME_IDEPARTITION             L"idepartition"

//
// IDEPartition
//

class IDEDrive;

class IDEPartition : public CDeviceDriver
{
public:
    CARAPI Read(
        /* [in] */ UInt64 u64Offset,
        /* [in] */ UInt32 bytesToRead,
        /* [out] */ MemoryBuf * pBuffer,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Write(
        /* [in] */ UInt64 u64Offset,
        /* [in] */ const MemoryBuf & buffer,
        /* [out] */ UInt32 * pBytesWritten,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Control(
        /* [in] */ Handle32 nControlCode,
        /* [in] */ const MemoryBuf & inBuffer,
        /* [out] */ MemoryBuf * pOutBuffer,
        /* [out] */ IEvent * * ppCompletionEvent);

    virtual void Dispose();

public:
    IDEPartition(IDEDrive *pDrive, uint_t uDeviceNo);

private:
    IDEDrive        *m_pDrive;
    uint_t          m_uDeviceNo;

    PartitionInfo   *m_pPartitionInfo;
};

#endif // __ELASTOS_IDEPARTITION_H__
